package park;

import java.util.Scanner;

public class J08SungJuk {
		//배열을 이용한 성적 처리
	public static void main(String[] args){
		
		//변수선언
		
		/*String name[] = new String[4];
		Scanner sc = new Scanner(System.in);
		String result="";
	
		int kor[] = new int[4];
		int eng[] = new int[4];
		int mat[] = new int[4];
		int tot[] = new int[4];
		double avg[] = new double[4];
		char [] grd = new char[4];
		

		for(int i =1; i<=3; ++i){
			
			name[i] = sc.next();
			 kor[i] = sc.nextInt();
			 eng[i] = sc.nextInt();
			 mat[i] = sc.nextInt();		 
			 tot[i] = kor[i]+eng[i]+mat[i];
			 avg[i] = tot[i]/3;
			 		 
			 switch((int)avg[i]/10){
			 
				 case 10:
				 case 9:grd[i]='수';break;
				 case 8:grd[i]='우';break;
				 case 7:grd[i]='미';break;
				 case 6:grd[i]='양';break;
				 default:grd[i]='가';
			 
			 result  += name[i]+"\t" + kor[i] + "\t" + eng[i] + "\t" + mat[i] + "\t" 
					 + tot[i] + "\t" + avg[i] +"\t" + grd[i] +"\n";
			 
			 
			 }
		}*/
		
		String name[]= new String[4];
		Scanner sc = new Scanner(System.in);
		String result = "";
		
		int kor[] = new int[4];
		int eng[] = new int[4];
		int mat[] = new int[4];
		int tot[] = new int[4];
		double avg[] = new double[4];
		char grd[] = new char[4];
		
		
		for(int i = 1; i<=3; ++i){
			name[i] = sc.next();
			kor[i] = sc.nextInt();
			eng[i] = sc.nextInt();
			mat[i] = sc.nextInt();
			tot[i] = kor[i]+eng[i]+mat[i];
			avg[i] = tot[i]/3;
			
			switch((int)avg[i]/10){
			
			case 10:
			case 9:grd[i]='수';break;
			case 8:grd[i]='우';break;
			case 7:grd[i]='미';break;
			case 6:grd[i]='양';break;
			default:grd[i]='가';
			
			result  += name[i]+"\t" + kor[i] + "\t" + eng[i] + "\t" + mat[i] + "\t" 
					 + tot[i] + "\t" + avg[i] +"\t" + grd[i] +"\n";
			
			
			}
			
		}
		
		
		
	
		//입력 및 성적처리
		
		
		
		
		
		//결과출력
		 
		
	
		System.out.println(result);
		
		sc.close();
		
	}

}
